#ifndef DIALOGMANAGER_HPP_INCLUDED
#define DIALOGMANAGER_HPP_INCLUDED
#include <string>
#include <stdio.h>
#include <cassert>
#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include "../Datas/Constante.hpp"

class DialogFontAnimated;
class GuiBox;
class GuiDialog;
class GuiChoice;
class CommandManager;
class Dialog;
class Core;
class DialogManager
{
    public:
         DialogManager(Core* core, float textSpeed);
        ~DialogManager();

        void draw(sf::RenderWindow* window);

        void update();

        void handleInput(sf::Event *event);

        void enableChoice(std::string yes, std::string no);
        void disableChoice();
        void newDialog(Dialog*dialog);
        void enableDialog(std::string msg);
        void disableDialog();

        GuiDialog* getDialogBox(){return guiDialog;}
        GuiChoice* getChoice(){return guiChoice;}
        Dialog* getCurrentDialog(){return currentDialog;}
        CommandManager* getCommandManager(){return commandManager;}

        bool isActiveOrWaiting();

    private:

        float textSpeed;
        CommandManager* commandManager;
        Dialog*currentDialog;
        GuiDialog* guiDialog;
        GuiChoice* guiChoice;
        Core* m_core;

        int nextChunkExitValue;

        void setNextCharPosition();
        void newLine();
        void reset();

};

#endif // DIALOGMANAGER_HPP_INCLUDED
